package com.apollographql.apollo.subscription;

import com.apollographql.apollo.api.ScalarTypeAdapters;
import com.apollographql.apollo.api.Subscription;
import com.apollographql.apollo.api.internal.json.JsonWriter;
import java.io.IOException;
import java.util.Map;
import com.kt.Deprecated;
import com.kt.Metadata;
import com.kt.jvm.internal.DefaultConstructorMarker;
import com.kt.jvm.internal.Intrinsics;
import okio.Buffer;

@Metadata(bv = {1, 0, 3}, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b6\u0018\u00002\u00020\u0001:\u0004\t\n\u000b\fB\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0007J\u0010\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007\u0001\u0004\r\u000e\u000f\u0010¨\u0006\u0011"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage;", "", "()V", "toJsonString", "", "writeToJson", "", "writer", "Lcom/apollographql/apollo/api/internal/json/JsonWriter;", "Init", "Start", "Stop", "Terminate", "Lcom/apollographql/apollo/subscription/OperationClientMessage$Init;", "Lcom/apollographql/apollo/subscription/OperationClientMessage$Start;", "Lcom/apollographql/apollo/subscription/OperationClientMessage$Stop;", "Lcom/apollographql/apollo/subscription/OperationClientMessage$Terminate;", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
/* compiled from: OperationClientMessage.kt */
public abstract class OperationClientMessage {
    private OperationClientMessage() {
    }

    public /* synthetic */ OperationClientMessage(DefaultConstructorMarker $constructor_marker) {
        this();
    }

    @Deprecated(message = "This method is deprecated. Use an OperationMessageSerializer instead.")
    public final String toJsonString() {
        try {
            Buffer buffer = new Buffer();
            ApolloOperationMessageSerializer.INSTANCE.writeClientMessage(this, buffer);
            return buffer.readUtf8();
        } catch (IOException e) {
            throw new RuntimeException("Failed to serialize to json", e);
        }
    }

    @Deprecated(message = "This method is deprecated. Use an OperationMessageSerializer instead.")
    public final void writeToJson(JsonWriter writer) throws IOException {
        Intrinsics.checkParameterIsNotNull(writer, "writer");
        ApolloOperationMessageSerializer.INSTANCE.writeContentsTo$apollo_runtime(this, writer);
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\u0010\u0000\n\u0002\b\u0003\u0018\u0000 \u00072\u00020\u0001:\u0001\u0007B\u001b\u0012\u0014\u0010\u0002\u001a\u0010\u0012\u0004\u0012\u00020\u0004\u0012\u0006\u0012\u0004\u0018\u00010\u00050\u0003¢\u0006\u0002\u0010\u0006R\u001e\u0010\u0002\u001a\u0010\u0012\u0004\u0012\u00020\u0004\u0012\u0006\u0012\u0004\u0018\u00010\u00050\u00038\u0006X\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Init;", "Lcom/apollographql/apollo/subscription/OperationClientMessage;", "connectionParams", "", "", "", "(Ljava/util/Map;)V", "Companion", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
    /* compiled from: OperationClientMessage.kt */
    public static final class Init extends OperationClientMessage {
        public static final Companion Companion = new Companion(null);
        public static final String TYPE = "connection_init";
        public final Map<String, Object> connectionParams;

        @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Init$Companion;", "", "()V", "TYPE", "", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
        /* compiled from: OperationClientMessage.kt */
        public static final class Companion {
            private Companion() {
            }

            public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
                this();
            }
        }

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public Init(Map<String, ? extends Object> map) {
            super(null);
            Intrinsics.checkParameterIsNotNull(map, "connectionParams");
            this.connectionParams = (Map<String, Object>) map;
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004\u0018\u0000 \f2\u00020\u0001:\u0001\fB9\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0012\u0010\u0004\u001a\u000e\u0012\u0002\b\u0003\u0012\u0002\b\u0003\u0012\u0002\b\u00030\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\u0006\u0010\n\u001a\u00020\t¢\u0006\u0002\u0010\u000bR\u0010\u0010\b\u001a\u00020\t8\u0006X\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0006\u001a\u00020\u00078\u0006X\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\n\u001a\u00020\t8\u0006X\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\u0004\u001a\u000e\u0012\u0002\b\u0003\u0012\u0002\b\u0003\u0012\u0002\b\u00030\u00058\u0006X\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Start;", "Lcom/apollographql/apollo/subscription/OperationClientMessage;", "subscriptionId", "", "subscription", "Lcom/apollographql/apollo/api/Subscription;", "scalarTypeAdapters", "Lcom/apollographql/apollo/api/ScalarTypeAdapters;", "autoPersistSubscription", "", "sendSubscriptionDocument", "(Ljava/lang/String;Lcom/apollographql/apollo/api/Subscription;Lcom/apollographql/apollo/api/ScalarTypeAdapters;ZZ)V", "Companion", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
    /* compiled from: OperationClientMessage.kt */
    public static final class Start extends OperationClientMessage {
        public static final Companion Companion = new Companion(null);
        public static final String TYPE = "start";
        public final boolean autoPersistSubscription;
        public final ScalarTypeAdapters scalarTypeAdapters;
        public final boolean sendSubscriptionDocument;
        public final Subscription<?, ?, ?> subscription;
        public final String subscriptionId;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public Start(String subscriptionId2, Subscription<?, ?, ?> subscription2, ScalarTypeAdapters scalarTypeAdapters2, boolean autoPersistSubscription2, boolean sendSubscriptionDocument2) {
            super(null);
            Intrinsics.checkParameterIsNotNull(subscriptionId2, "subscriptionId");
            Intrinsics.checkParameterIsNotNull(subscription2, "subscription");
            Intrinsics.checkParameterIsNotNull(scalarTypeAdapters2, "scalarTypeAdapters");
            this.subscriptionId = subscriptionId2;
            this.subscription = subscription2;
            this.scalarTypeAdapters = scalarTypeAdapters2;
            this.autoPersistSubscription = autoPersistSubscription2;
            this.sendSubscriptionDocument = sendSubscriptionDocument2;
        }

        @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Start$Companion;", "", "()V", "TYPE", "", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
        /* compiled from: OperationClientMessage.kt */
        public static final class Companion {
            private Companion() {
            }

            public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
                this();
            }
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\u0018\u0000 \u00052\u00020\u0001:\u0001\u0005B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0004¢\u0006\u0002\n\u0000¨\u0006\u0006"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Stop;", "Lcom/apollographql/apollo/subscription/OperationClientMessage;", "subscriptionId", "", "(Ljava/lang/String;)V", "Companion", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
    /* compiled from: OperationClientMessage.kt */
    public static final class Stop extends OperationClientMessage {
        public static final Companion Companion = new Companion(null);
        public static final String TYPE = "stop";
        public final String subscriptionId;

        @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Stop$Companion;", "", "()V", "TYPE", "", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
        /* compiled from: OperationClientMessage.kt */
        public static final class Companion {
            private Companion() {
            }

            public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
                this();
            }
        }

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public Stop(String subscriptionId2) {
            super(null);
            Intrinsics.checkParameterIsNotNull(subscriptionId2, "subscriptionId");
            this.subscriptionId = subscriptionId2;
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u0000 \u00032\u00020\u0001:\u0001\u0003B\u0005¢\u0006\u0002\u0010\u0002¨\u0006\u0004"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Terminate;", "Lcom/apollographql/apollo/subscription/OperationClientMessage;", "()V", "Companion", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
    /* compiled from: OperationClientMessage.kt */
    public static final class Terminate extends OperationClientMessage {
        public static final Companion Companion = new Companion(null);
        public static final String TYPE = "connection_terminate";

        @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lcom/apollographql/apollo/subscription/OperationClientMessage$Terminate$Companion;", "", "()V", "TYPE", "", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
        /* compiled from: OperationClientMessage.kt */
        public static final class Companion {
            private Companion() {
            }

            public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
                this();
            }
        }

        public Terminate() {
            super(null);
        }
    }
}
